<?php
/**
 * @var $model Training
 * @var $this TrainingController
 */
$this->breadcrumbs = array(
    'Khóa học' => array('training/index'),
    $model->name,
);
$this->pageTitle = $model->name;
?>
<div class="left">
    <div id="list-training">

        <?php if($model->image_id): ?><div><img src="<?php echo Yii::app()->baseUrl.'/' . $model->image->path; ?>"></div><?php endif?>
        <div class="title">
            <h1 style="font-size: 2.2em;#111111;margin-top:10px;line-height: 1.364em"><?php echo $model->name; ?></h1>
        </div>
        <div class="list-class">
            <div style="padding: 1px;background: #fff;">
                <div class="title">Các lớp học của khóa này</div>
            </div>
            <div class="content">
                <?php if ($model->classCount) {
                $this->renderPartial('_guitarclass', array('guitarclass' => $model->classes));
            } else {
                echo 'Hiện chưa có lớp nào được tổ chức';
            } ?>
            </div>
        </div>
        <div class="body" style="margin-top: 5px;">
            <?php echo $model->description;?>
        </div>

        <div style="margin: 10px 0px;">
            <!-- AddThis Button BEGIN -->
            <div class="addthis_toolbox addthis_default_style ">
                <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
                <a class="addthis_button_tweet"></a>
                <a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
                <a class="addthis_counter addthis_pill_style"></a>
            </div>
            <script type="text/javascript">//var addthis_config = {"data_track_addressbar":true};</script>
            <script type="text/javascript"
                    src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4f88f64654f5680c"></script>
            <!-- AddThis Button END -->
        </div>
        <?php
        $this->renderPartial('_other_training', array('dataProvider' => $model->getOthers()));
        ?>
        <div id="comments">
            <?php if ($model->commentCount >= 1): ?>
            <h2>
                <?php echo $model->commentCount . ' Comments'; ?>
            </h2>

            <?php $this->renderPartial('_comments', array(
                'training' => $model,
                'comments' => $model->comments,
            )); ?>
            <?php endif; ?>

            <?php if (Yii::app()->user->checkAccess('comment')): ?>
            <h3 style="margin-top: 1em;b">Gửi bình luận</h3>

            <?php if (Yii::app()->user->hasFlash('commentSubmitted')): ?>
                <div class="flash-success">
                    <?php echo Yii::app()->user->getFlash('commentSubmitted'); ?>
                </div>
                <?php else: ?>
                <?php $this->renderPartial('/comment/_form', array(
                    'model' => $comment,
                )); ?>
                <?php endif; ?>
            <?php else: ?>
            <div> <?php echo CHtml::link('Đăng nhập', $this->createUrl('/site/login')); ?> để đăng bình luận.</div>
            <?php endif; ?>
            <div style="border-top: 1px solid #ccc">
                <h2 style="padding: 5px">Bình luận từ Facebook</h2>
                <div class="fb-comments" data-href="http://hocgioi.com.vn/lnt" data-num-posts="2" data-width="470"></div>
            </div>
        </div>
        <!-- comments -->
    </div>
</div>
<div class="right">
    <?php
    $this->beginWidget('zii.widgets.CPortlet', array('title' => 'Cơ sở đào tạo'));
    $this->widget('FacilityList');
    $this->endWidget();
    ?>
</div>



